﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="fabubook.aspx.cs" Inherits="fabubook" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人书刊信息发布</title>
<link rel="stylesheet" type="text/css" href="wuliu.css">
      
        <style type="text/css">
            #form2
            {
                height: 1028px;
            }
        </style>
      
</head>

<body>
<form id="form2" runat="server" >
<div id="container">
	<div id="top">
    	<div id="header"></div>
        <div id="menu">
        	<ul>
            	<li><a href="index.aspx">首页</a></li>
                <li><a href="user.aspx">个人中心</a></li>
                <li><a href="fabuelc.aspx">管理家电信息</a></li>
                <li><a href="fabuhelp.aspx">管理求助信息</a></li>
                <li><a href="fabuteach.aspx">管理服务信息</a></li>
                  <li><a href="fabuxinxi.aspx">发布新信息</a></li>
            </ul>
        </div>
    </div>	
    <div id="content">
      <div id="main" >
      
          <asp:ListView ID="ListView1" runat="server" DataKeyNames="book_id" 
              DataSourceID="SqlDataSource1" InsertItemPosition="LastItem">
              <AlternatingItemTemplate>
                  <tr style="background-color:#FFF8DC;">
                      <td>
                          <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="删除" />
                          <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="编辑" />
                      </td>
                      <td>
                          <asp:Label ID="user_idLabel" runat="server" Text='<%# Eval("user_id") %>' />
                      </td>
                      <td>
                          <asp:Label ID="user_datepbLabel" runat="server" 
                              Text='<%# Eval("user_datepb") %>' />
                      </td>
                      <td>
                          <asp:Label ID="user_pbmsgLabel" runat="server" 
                              Text='<%# Eval("user_pbmsg") %>' />
                      </td>
                      <td>
                          <asp:Label ID="book_idLabel" runat="server" Text='<%# Eval("book_id") %>' />
                      </td>
                  </tr>
              </AlternatingItemTemplate>
              <LayoutTemplate>
                  <table runat="server">
                      <tr runat="server">
                          <td runat="server">
                              <table ID="itemPlaceholderContainer" runat="server" border="1" 
                                  style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                                  <tr runat="server" style="background-color:#DCDCDC;color: #000000;">
                                      <th runat="server">
                                      </th>
                                      <th runat="server">
                                          用户ID</th>
                                      <th runat="server">
                                          发布日期</th>
                                      <th runat="server">
                                           标题</th>
                                      <th runat="server">
                                          产品ID</th>
                                  </tr>
                                  <tr ID="itemPlaceholder" runat="server">
                                  </tr>
                              </table>
                          </td>
                      </tr>
                      <tr runat="server">
                          <td runat="server" 
                              style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                              <asp:DataPager ID="DataPager1" runat="server">
                                  <Fields>
                                      <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                          ShowLastPageButton="True" />
                                  </Fields>
                              </asp:DataPager>
                          </td>
                      </tr>
                  </table>
              </LayoutTemplate>
              <InsertItemTemplate>
                  <tr style="">
                      <td>
                          <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="插入" />
                          <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="清除" />
                      </td>
                      <td>
                          <asp:TextBox ID="user_idTextBox" runat="server" Text='<%# Bind("user_id") %>' />
                      </td>
                      <td>
                          <asp:TextBox ID="user_datepbTextBox" runat="server" 
                              Text='<%# Bind("user_datepb") %>' />
                      </td>
                      <td>
                          <asp:TextBox ID="user_pbmsgTextBox" runat="server" 
                              Text='<%# Bind("user_pbmsg") %>' />
                      </td>
                      <td>
                          &nbsp;</td>
                  </tr>
              </InsertItemTemplate>
              <SelectedItemTemplate>
                  <tr style="background-color:#008A8C;font-weight: bold;color: #FFFFFF;">
                      <td>
                          <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="删除" />
                          <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="编辑" />
                      </td>
                      <td>
                          <asp:Label ID="user_idLabel" runat="server" Text='<%# Eval("user_id") %>' />
                      </td>
                      <td>
                          <asp:Label ID="user_datepbLabel" runat="server" 
                              Text='<%# Eval("user_datepb") %>' />
                      </td>
                      <td>
                          <asp:Label ID="user_pbmsgLabel" runat="server" 
                              Text='<%# Eval("user_pbmsg") %>' />
                      </td>
                      <td>
                          <asp:Label ID="book_idLabel" runat="server" Text='<%# Eval("book_id") %>' />
                      </td>
                  </tr>
              </SelectedItemTemplate>
              <EmptyDataTemplate>
                  <table runat="server" 
                      style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                      <tr>
                          <td>
                              未返回数据。</td>
                      </tr>
                  </table>
              </EmptyDataTemplate>
              <EditItemTemplate>
                  <tr style="background-color:#008A8C;color: #FFFFFF;">
                      <td>
                          <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="更新" />
                          <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="取消" />
                      </td>
                      <td>
                          <asp:TextBox ID="user_idTextBox" runat="server" Text='<%# Bind("user_id") %>' />
                      </td>
                      <td>
                          <asp:TextBox ID="user_datepbTextBox" runat="server" 
                              Text='<%# Bind("user_datepb") %>' />
                      </td>
                      <td>
                          <asp:TextBox ID="user_pbmsgTextBox" runat="server" 
                              Text='<%# Bind("user_pbmsg") %>' />
                      </td>
                      <td>
                          <asp:Label ID="book_idLabel1" runat="server" Text='<%# Eval("book_id") %>' />
                      </td>
                  </tr>
              </EditItemTemplate>
              <ItemTemplate>
                  <tr style="background-color:#DCDCDC;color: #000000;">
                      <td>
                          <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="删除" />
                          <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="编辑" />
                      </td>
                      <td>
                          <asp:Label ID="user_idLabel" runat="server" Text='<%# Eval("user_id") %>' />
                      </td>
                      <td>
                          <asp:Label ID="user_datepbLabel" runat="server" 
                              Text='<%# Eval("user_datepb") %>' />
                      </td>
                      <td>
                          <asp:Label ID="user_pbmsgLabel" runat="server" 
                              Text='<%# Eval("user_pbmsg") %>' />
                      </td>
                      <td>
                          <asp:Label ID="book_idLabel" runat="server" Text='<%# Eval("book_id") %>' />
                      </td>
                  </tr>
              </ItemTemplate>
          </asp:ListView>
          <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
              ConnectionString="<%$ ConnectionStrings:infoConnectionString %>" 
              DeleteCommand="DELETE FROM [b_infobook] WHERE [book_id] = @book_id" 
              InsertCommand="INSERT INTO [b_infobook] ([user_id], [user_datepb], [user_pbmsg]) VALUES (@user_id, @user_datepb, @user_pbmsg)" 
              SelectCommand="SELECT * FROM [b_infobook] WHERE ([user_id] = @user_id)" 
              UpdateCommand="UPDATE [b_infobook] SET [user_id] = @user_id, [user_datepb] = @user_datepb, [user_pbmsg] = @user_pbmsg WHERE [book_id] = @book_id">
              <SelectParameters>
                  <asp:SessionParameter Name="user_id" SessionField="userid" Type="String" />
              </SelectParameters>
              <DeleteParameters>
                  <asp:Parameter Name="book_id" Type="Int32" />
              </DeleteParameters>
              <UpdateParameters>
                  <asp:Parameter Name="user_id" Type="String" />
                  <asp:Parameter Name="user_datepb" Type="String" />
                  <asp:Parameter Name="user_pbmsg" Type="String" />
                  <asp:Parameter Name="book_id" Type="Int32" />
              </UpdateParameters>
              <InsertParameters>
                  <asp:Parameter Name="user_id" Type="String" />
                  <asp:Parameter Name="user_datepb" Type="String" />
                  <asp:Parameter Name="user_pbmsg" Type="String" />
              </InsertParameters>
          </asp:SqlDataSource>
          
      
    
	      
	   </div>
  </div>
    <div id="footer">
        版权所有 Copyright ©长江大学计算机科学学院 All Rights Reserveda 
        href=&quot;#&quot;&gt;联系站长&quot;#&quot;&gt;网站地图;#&quot;&gt;联系站长&quot;#&quot;&gt;网站地图</a>
    </div>
</div>
</form>
</body>

</html>

